<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/includes.jsp" %>
<html>
 <head>
    <title>附件列表</title>
    <!-- import css and js -->
	<%@ include file="/common/meta.jsp" %>
	<script src="${ctx}/js/ligerUI/js/plugins/ligerLayout.js" type="text/javascript"></script>
	<script src="${ctx}/js/jsp/comm.js" type="text/javascript"></script>
	<script type="text/javascript">
		var saleId = '${saleId}';
		var basic_Url="${ctx}/public/windowalert";
		var basic_FileUrl = "${ctx}/attach/upload";
		var fileGrid ;
		function downUploadFile(rowIndex){
			var fileName = rowIndex.fileName;
			var diskPath = rowIndex.diskPath;
			var path = basic_FileUrl + "/filedown.do?diskPath="+diskPath+"&fileName="+fileName;
			window.open(path, "_blank");
		}
		$(function(){
			fileGrid = $("#table1").ligerGrid({
				columns: [
		                  { display: '附件ID', name: 'id', width: 145 ,hide : 1},
		                  { display: '附件名称', name: 'fileName', width: 165,render: function (record, rowindex, value, column) {
				 			  var rc = JSON.stringify(record);
				 		  	  return "<a href='javascript:downUploadFile("+rc+")'>"+value+"</a>";
				 		  }},
		                  { display: '附件大小', name: 'fileSize', width: 145 },
		                  { display: '上传人', name: 'uploadUserName', width: 145 },
		                  { display: '上传时间', name: 'uploadDate', width: 145,
		                	  render: function (item){
		                		  var upDate=new Date(item.uploadDate);
		                		  return formatDate(upDate,"yyyy-MM-dd");
		                  }},
		                  { display: '附件类型', name: 'fileContentType', width: 145 }
		                 ],  
		        	usePager: true,pageSize:30,
		            url : basic_Url+"/uploadFileList.do?saleId="+saleId,
		            width: "100%", height:"98%", checkbox: false
		         });
			$("#pageloading").hide();
		});
		function Close(){
			CloseDialog();
		}
		
	</script>
	
  </head>
 <body style="padding:10px">  
       <div id="layout1">
          <div id="pageHeader" class="pageHeader">
               <div class="searchBar" id="multipleSearchDialog">
	                <table class="table" width="100%" id="searchHeader" >  
                        <tbody id="newbody">
                        </tbody>
 	                </table>
                    <!-- <div class="subBar">
			             <ul>
				             <li>
				             	<div class="buttonActive">
				             		<div class="buttonContent">
				             			<button type="submit" id="btnSearch" onclick="searchAP()">查询</button>
				             		</div>
				             	</div>
				             </li>
				             <li><a class="button" onclick="clearSearch()"><span>重置</span></a></li>
			             </ul>
	                </div> -->
               </div>
          </div>
      </div>
      <div position="center" id="table1">
      </div>
      <div class="clear"></div>
    </body>
</html>